<?php


/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Badge
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
 
 
?>
<div class='layout_right badge_view_layout_right'>
  <div class='badges_gutter'>
    <div class='badge_award_badge'>
      <?php echo $this->htmlLink($this->user->getHref(),
        $this->itemPhoto($this->user, 'thumb.profile')
      )?>
      <?php echo $this->htmlLink($this->user->getHref(),
        $this->user->getTitle(),
        array('class' => 'badge_award_badge_title')
      )?>
    </div>  
  
  </div>
</div>

<div class='layout_middle badge_layout_middle'>
  <div class='badge_award_view'>
    <h2>
      <?php echo $this->translate('%s\'s Awarded Badges', $this->user->__toString())?>
    </h2>
    
    
    <?php if( $this->paginator->getTotalItemCount() > 0 ): ?>
      <ul class='profile_badge_awards badges_awards_list'>
        <?php foreach ($this->paginator as $award): ?>
          <?php 
            $badge = $award->getBadge(); 
            $user = $award->getUser();
          ?>
        <li>
          <div class='badge_award_photo'>
            <?php echo $this->htmlLink($badge->getHref(), $this->itemPhoto($badge, 'thumb.normal'));?>
          </div>
          <div class='badge_award_info'>
            <div class='badge_award_title'>
              <?php echo $award->__toString(); ?>
            </div>
            <div class='badge_award_meta'>
              <?php echo $this->translate('Awarded %1$s badge on %2$s', $badge->__toString(), $this->locale()->toDate($award->creation_date)); ?>
                -
                <?php echo $this->translate(array("%s comment", "%s comments", $award->comment_count), $this->locale()->toNumber($award->comment_count)); ?>
                -
                <?php echo $this->translate(array('%1$s like', '%1$s likes', $award->like_count), $this->locale()->toNumber($award->like_count)); ?>
            </div>
            <div class='badge_award_desc'>
              <?php echo $this->viewMore($award->getDescription()); ?>
            </div>
          </div>
        </li>
        <?php endforeach; ?>
      </ul>
    <?php else: ?>
      <div class="tip">
        <span>
          <?php echo $this->translate('This member currently does not have any awarded badges.');?>
        </span>
      </div>
    <?php endif; ?>
  </div>
</div>